package com.pcbly.web.components.utils.converters;

import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.LongConverter;

public class MyLongConverter implements Converter {

	private static Long newLong() {
		return new Long(0L);
	}
	@SuppressWarnings("unchecked")
	public Object convert(Class type, Object value) {
		if (type.equals(Long.TYPE) && value == null)
			return newLong();
		else
			return (new LongConverter()).convert(type, value);
	}

	public MyLongConverter() {

	}
}
